const mongoose = require('mongoose');

const messageSchema = new mongoose.Schema({
  ToUserName: {
    type: String,
    required: true
  },
  FromUserName: {
    type: String,
    required: true
  },
  CreateTime: {
    type: Date,
    default: Date.now
  },
  MsgType: {
    type: String,
    required: true
  },
  Content: String,
  MsgId: Number,
  Event: String,
  EventKey: String,
  PicUrl: String,
  MediaId: String,
  Format: String,
  Recognition: String,
  ThumbMediaId: String,
  Location_X: Number,
  Location_Y: Number,
  Scale: Number,
  Label: String,
  Title: String,
  Description: String,
  Url: String
}, {
  timestamps: true
});

module.exports = mongoose.model('Message', messageSchema);  